/*
 * ethernet.h
 *
 *  Created on: Mar 3, 2010
 *      Author: Nikhil
 */



/*
 * ethernet.c
 *
 *  Created on: Mar 2, 2010
 */
#include <stdio.h>
#include <string.h>

#include <avr32/io.h>
#include "print_funcs.h"
#include "usart.h"
#include "board.h"
#include "SOFTWARE_FRAMEWORK/DRIVERS/MACB/macb.h"
#include "gpio.h"
#include "compiler.h"
#include "CONFIG/conf_eth.h"
#include "SOFTWARE_FRAMEWORK/DRIVERS/FLASHC/flashc.h"
#include "pm.h"
#include "intc.h"



#ifndef ETHERNET_H_


#define ETHERNET_H_

/**
 * \brief Checksum routine for Internet Protocol family headers
 *
 * \param  addr   address of data to compute checksum
 * \param  len    length of data to compute checksum
 *
 * \return unsigned short checksum computed
 */
unsigned short in_cksum(unsigned short *addr, int len);


/*!
 * \brief function to send PING response to pkt->data->host
 *
 * \param pkt packet to manage
 */
void macb_example_send_ping_response(macb_packet_t *pkt);

/*!
 * \brief callback to manage packets reception
 * \param pkt packet to manage
 */
void macb_example_receive_packet(macb_packet_t *pkt);


/*! \brief Send an ARP request to host
 *
 */
static void macb_example_send_ARP_request(void);

/*!
 * \brief start a PLL @ 48Mhz to run with
 */
void local_start_pll(void);








#endif /* ETHERNET_H_ */
